/**
 * Author:yuiop
 * Date:2022/8/30 15:36
 */
package com.devops.admin.graphql;

import com.devops.admin.model.DOSMetricsDb;
import com.devops.admin.service.DOSMetricsDbService;
import com.devops.common.annotation.DOSLog;
import com.devops.constant.DevOpsConstant;
import com.netflix.graphql.dgs.DgsComponent;
import com.netflix.graphql.dgs.DgsQuery;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@DgsComponent
public class DOSMetricsDbDataFetcher {
    @Autowired
    DOSMetricsDbService dosMetricsDbService;


    @RequiresPermissions(DevOpsConstant.RoleCode.LOGIN_USER)
    @DOSLog(description = "获取指标相关的所有数据库信息")
    @DgsQuery
    public List<DOSMetricsDb> getAllMetricsDbs() {
        return dosMetricsDbService.getAllMetricsDbs();
    }

}
